// ignore_for_file: constant_identifier_names, prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:junyeyishu/mianTab.dart';
import 'package:junyeyishu/ui/colorfulSynthesis/QGColrfulSynthesisList.dart';
import 'package:junyeyishu/ui/colorfulSynthesis/QGColrfulSynthesisPage.dart';
import 'package:junyeyishu/ui/colorfulSynthesis/QGColrfulSynthesisRecordPage.dart';
import 'package:junyeyishu/ui/sale/QGSaleCopyrightNFTDetail.dart';
import 'package:junyeyishu/ui/synthesis/QGSynthesisList.dart';
import 'package:junyeyishu/ui/synthesis/QGSynthesisPage.dart';
import 'package:junyeyishu/ui/synthesis/QGSynthesisRecordPage.dart';
import 'package:junyeyishu/ui/home/QGInvitePage.dart';
import 'package:junyeyishu/ui/home/listSingle.dart';
import 'package:junyeyishu/ui/home/QGNFTDetailPage.dart';
import 'package:junyeyishu/ui/home/QGOpenBoxRecordPage.dart';
import 'package:junyeyishu/ui/home/QGOrderConfirmPage.dart';
import 'package:junyeyishu/ui/home/QGReviewNFTDetail.dart';
import 'package:junyeyishu/ui/home/QGRulePage.dart';


import 'package:junyeyishu/ui/home/QGInvitePagemingrentang.dart';





import 'package:junyeyishu/ui/load/LoadPage.dart';
import 'package:junyeyishu/ui/login/QGLoginPage.dart';
import 'package:junyeyishu/ui/login/QGVerifyAliPage.dart';
import 'package:junyeyishu/ui/mine/HFSelectWalletPage.dart';
import 'package:junyeyishu/ui/mine/QGMinePasswordPage.dart';
import 'package:junyeyishu/ui/mine/QGMineBatchOrderPage.dart';
import 'package:junyeyishu/ui/mine/QGMineHomeOrderPage.dart';
import 'package:junyeyishu/ui/mine/QGMineNFTDetailPage.dart';
import 'package:junyeyishu/ui/mine/QGMinePurchaseOrderDetailPage.dart';
import 'package:junyeyishu/ui/mine/QGMinePurchaseOrderPage.dart';
import 'package:junyeyishu/ui/mine/QGMineReviewNFTDetail.dart';
import 'package:junyeyishu/ui/mine/QGNFTSendRecord.dart';
import 'package:junyeyishu/ui/mine/QGOpenWalletPage.dart';
import 'package:junyeyishu/ui/bulletin/QGBulletinAboutGoodsPage.dart';
import 'package:junyeyishu/ui/bulletin/QGBulletinDetailPage.dart';
import 'package:junyeyishu/ui/bulletin/QGBulletinSearchPage.dart';
import 'package:junyeyishu/ui/mine/QGMineNFTPage.dart';
import 'package:junyeyishu/ui/mine/QGMineOrderPage.dart';
import 'package:junyeyishu/ui/displace/QGDisplaceDetail.dart';
import 'package:junyeyishu/ui/displace/QGDisplaceList.dart';
import 'package:junyeyishu/ui/displace/QGDisplaceRecord.dart';
import 'package:junyeyishu/ui/sale/QGInitiatePurchasePage.dart';
import 'package:junyeyishu/ui/sale/QGPurchaseConfirmPage.dart';
import 'package:junyeyishu/ui/sale/QGReviewSaleDetailPage.dart';
import 'package:junyeyishu/ui/sale/QGSaleBuyListPage.dart';
import 'package:junyeyishu/ui/sale/QGSaleCategoryPage.dart';
import 'package:junyeyishu/ui/sale/QGSaleDetailPage.dart';
import 'package:junyeyishu/ui/mine/QGMineAccountPage.dart';
import 'package:junyeyishu/ui/mine/QGMineAccountPagePawss.dart';

import 'package:junyeyishu/ui/mine/QGMineModifyTradePasswordPage.dart';
import 'package:junyeyishu/ui/mine/QGMineLogoffPage.dart';
import 'package:junyeyishu/ui/mine/QGMineAuthentPage.dart';
import 'package:junyeyishu/ui/sale/QGSaleNFTDetail.dart';
import 'package:junyeyishu/ui/mine/QGMineHasAuthentPage.dart';
import 'package:junyeyishu/ui/mine/QGMineCommitmentPage.dart';
import 'package:junyeyishu/ui/mine/QGMineAvatarClipPage.dart';
import 'package:junyeyishu/ui/sale/QGSaleOrderConfirmPage.dart';
import 'package:junyeyishu/ui/mine/QGMineOrderDetailPage.dart';
import 'package:junyeyishu/widgets/QGPayWebView.dart';
import 'package:junyeyishu/widgets/QGWebView.dart';
import 'package:junyeyishu/widgets/QGWebWalletView.dart';

import 'package:junyeyishu/lottery/index.dart';
import 'package:junyeyishu/lottery/record.dart';

import 'package:junyeyishu/download.dart';
 
const PageQGInviteMinPage =  'QGInviteMinPage';

const pageSettingPage =  'SettingPage';
const pageRecordPage =  'recordPage';

const PageQGDown =  'QGDown';
// 加载
const PageLoad = "PageLoad";
const PageMainTab = "PageMainTab";
const PageWebView = "PageWebView";
const PageWebWalletView = "PageWebWalletView";

const PageQGWebView = "PageQGWebView";
const PageQGPayWebView = "PageQGPayWebView";

// 登录模块
const PageLogin = "PageLogin";
const PageVerifyAli = "PageVerifyAli";

// 首页模块
const PageInvite = "PageInvite";
const PageListSingle = "PageListSingle";

const PageNFTDetail = "PageNFTDetail";
const PageOpenRecord = "PageOpenRecord";
const PageNFTCalendar = "PageNFTCalendar";

// 合成
const PageSynthesisList = "PageSynthesisList";
const PageSynthesis = "PageSynthesis";
const PageSynthesisRecord = "PageSynthesisRecord";

// 缤纷合成
const PageColorfulSynthesisList = "PageColorfulSynthesisList";
const PageColorfulSynthesis = "PageColorfulSynthesis";
const PageColorfulSynthesisRecord = "PageColorfulSynthesisRecord";

// 规则
const PageRule = "PageRule";
const PageOrderConfirm = "PageOrderConfirm";

const PageReviewNFTDetail = "PageReviewNFTDetail";

// 分解
const PageDisplaceList = "PageDisplaceList";
const PageDisplaceDetail = "PageDisplaceDetail";
const PageDisplaceRecord = "PageDisplaceRecord";

// 公告
const PageBiddingList = "PageBiddingList";
const PageBidding = "PageBidding";
const PageBiddingRecord = "PageBiddingRecord";

// 寄售模块
const PageTradeDetail = "PageTradeDetail";
const PageReviewTradeDetail = "PageReviewTradeDetail";
const PageTradeNFTDetail = "PageTradeNFTDetail";
const PageTradeCopyrightNFTDetail = "PageTradeCopyrightNFTDetail";
const PageMyOrderDetail = "PageMyOrderDetail";
const PageTradeRecord = "PageTradeRecord";
const PageTradeOrderConfirm = "PageTradeOrderConfirm";
const PageTradeCategory = "PageTradeCategory";
const PagePurchaseConfirm = "PagePurchaseConfirm";
const PageInitiatePurchase = "PageInitiatePurchase";
const PageTradeBuyList = "PageTradeBuyList";

// 公告模块
const PageNoticeDetial = "PageNoticeDetial";
const PageNoticeSearch = "PageNoticeSearch";
const PageSysNotice = "PageSysNotice";
const PageNoticeAboutGoods = "PageNoticeAboutGoods";

// 我的模块
const PageMyNFT = "PageMyNFT";
const PageMyOrder = "PageMyOrder";
const PageMyBatchOrder = "PageMyBatchOrder";
const PageMyPurchaseOrder = "PageMyPurchaseOrder";
const PageMyHomeOrder = "PageMyHomeOrder";
const PageMyPurchaseOrderDetail = "PageMyPurchaseOrderDetail";

const PageMyNFTDetail = "PageMyNFTDetail";
const PageNFTSendRecord = "PageNFTSendRecord";

const PageMyReviewNFTDetail = "PageMyReviewNFTDetail";
const PageMyCart = "PageMyCart";

// 关于
const PageAbout = "PageAbout";
const PageAboutUs = "PageAboutUs";

const PageOpenWallet = "PageOpenWallet";
const PageSelectWallet = "PageSelectWallet";

const PageMineAccount = 'PageMineAccount';
const PageMineAccountPagepawss = 'PageMineAccountPagepawss';

const pageMineLoginPassword = 'pageMineLoginPassword';
const pageTradePassword = "pageTradePassword";
const pageLogoff = 'pageLogoff';

// 认证
const pageMineAuthent = 'pageMineAuthent';
const pageMineHasAuthent = 'pageMineHasAuthent';
const pageMineCommitment = 'pageMineCommitment';
const pageMineClipAvatar = 'pageMineClipAvatar';

class XYRoute extends Navigator {
  static Map<String, WidgetBuilder> routes = {


    PageQGInviteMinPage: (ctx, [args]) => QGInviteMinPage(),
    pageRecordPage: (ctx, [args]) => recordPage(),
    
    pageSettingPage: (ctx, [args]) => SettingPage(),
    PageQGDown: (ctx, [args]) => QGDown(),

    PageMainTab: (ctx, [args]) => MainTab(indexa: args),
    PageLoad: (ctx) => LoadPage(),
    PageWebView: (ctx, [args]) => QGWebView(url: args),
    PageWebWalletView: (ctx, [args]) => QGWebWalletView(url: args),
    PageQGWebView: (ctx, [args]) => QGWebView(url: args),
    PageQGPayWebView: (ctx, [args]) => QGPayWebView(url: args),
    // 登录模块
    PageLogin: (ctx) => QGLoginPage(),
    PageVerifyAli: (ctx, [args]) => QGVerifyAliPage(phone: args),

    // 首页模块
    PageOpenRecord: (ctx, [args]) => QGOpenBoxRecordPage(id: args),
    PageNFTDetail: (ctx, [args]) => QGNFTDetailPage(id: args),
    PageInvite: (ctx) => QGInvitePage(),

    PageListSingle: (ctx) => listSinglePage(),

    // 合成
    PageSynthesisList: (ctx) => QGSynthesisList(),
    PageSynthesis: (ctx, [args]) => QGSynthesisPage(id: args),
    PageSynthesisRecord: (ctx, [args]) => QGSynthesisRecordPage(id: args),

    // 缤纷合成
    PageColorfulSynthesisList: (ctx) => QGColrfulSynthesisList(),
    PageColorfulSynthesis: (ctx, [args]) => QGColrfulSynthesisPage(id: args),
    PageColorfulSynthesisRecord: (ctx, [args]) =>
        QGColrfulSynthesisRecordPage(id: args),

    // 规则
    PageRule: (ctx, [args]) => QGRulePage(args: args),
    PageReviewNFTDetail: (ctx, [args]) => QGReviewNFTDetail(id: args),
    PageOrderConfirm: (ctx, [args]) => QGOrderConfirmPage(args: args),

    // 分解模块
    PageDisplaceList: (ctx) => QGDisplaceList(),
    PageDisplaceDetail: (ctx, [args]) => QGDisplaceDetail(id: args),
    PageDisplaceRecord: (ctx, [args]) => QGDisplaceRecord(id: args),

    // 寄售模块
    PageTradeDetail: (ctx, [args]) => QGSaleDetailPage(id: args),
    PageReviewTradeDetail: (ctx, [args]) => QGReviewSaleDetailPage(id: args),
    PageTradeNFTDetail: (ctx, [args]) => QGSaleNFTDetail(id: args),
    PageTradeCopyrightNFTDetail: (ctx, [args]) =>
        QGSaleCopyrightNFTDetail(id: args),

    PageMyOrderDetail: (ctx, [args]) => QGMineOrderDetailPage(data: args),
    PageTradeOrderConfirm: (ctx, [args]) => QGSaleOrderConfirmPage(args: args),
    PageTradeCategory: (ctx) => QGSaleCategoryPage(),
    PagePurchaseConfirm: (ctx, [args]) => QGPurchaseConfirmPage(args: args),
    PageInitiatePurchase: (ctx, [args]) => QGInitiatePurchasePage(args: args),
    PageTradeBuyList: (ctx, [args]) => QGSaleBuyListPage(data: args),

    // 公告模块
    PageNoticeDetial: (ctx, [args]) => QGBulletinDetailPage(args: args),
    PageNoticeSearch: (ctx, [args]) => QGBulletinSearchPage(text: args),
    PageNoticeAboutGoods: (ctx, [args]) => QGBulletinAboutGoodsPage(pid: args),

    // 我的模块
    PageMyNFT: (ctx) => QGMineNFTPage(),
    PageMyOrder: (ctx) => QGMineOrderPage(),
    PageMyBatchOrder: (ctx) => QGMineBatchOrderPage(),
    PageMyPurchaseOrder: (ctx) => QGMinePurchaseOrderPage(),
    PageMyHomeOrder: (ctx) => QGMineHomeOrderPage(),
    PageMyNFTDetail: (ctx, [args]) => QGMineNFTDetailPage(id: args),
    PageMyPurchaseOrderDetail: (ctx, [args]) =>
        QGMinePurchaseOrderDetailPage(data: args),
    PageOpenWallet: (ctx) => QGOpenWalletPage(),
    PageSelectWallet: (ctx) => HFSelectWalletPage(),
    PageNFTSendRecord: (ctx) => QGNFTSendRecord(),
    PageMyReviewNFTDetail: (ctx, [args]) => QGMineReviewNFTDetail(id: args),

    // 账户 QGMineAccountPage
    PageMineAccount: (ctx, [args]) => QGMineAccountPage(userInfo: args),

    PageMineAccountPagepawss: (ctx, [args]) => QGMineAccountPagepawss(userInfo: args),

    pageTradePassword: (ctx) => QGModifyTradePasswordPage(),
    pageMineLoginPassword: (ctx) => QGMinePasswordPage(),
    pageLogoff: (ctx) => QGMineLogoffPage(),
    pageMineAuthent: (ctx) => QGMineAuthentPage(),
    pageMineHasAuthent: (ctx, [args]) => QGMineHasAuthentPage(),
    pageMineCommitment: (ctx) => QGMineCommitmentPage(),
    pageMineClipAvatar: (ctx, [args]) => QGMineAvatarClipPage(imageByte: args),
  };

  // 配置路由参数
  static RouteFactory generateRoute = (settings) {
    if (!XYRoute.routes.keys.contains(settings.name)) {
      return null;
    }

    Widget Function(BuildContext) builder;
    var pageBuilder = XYRoute.routes[settings.name];

    if (settings.arguments != null) {
      pageBuilder as Widget Function(BuildContext, [dynamic]);
      builder = (ctx) => pageBuilder(ctx, settings.arguments);
    } else {
      pageBuilder as Widget Function(BuildContext);
      builder = (ctx) => pageBuilder(ctx);
    }
    return MaterialPageRoute(builder: builder);
  };

  const XYRoute({Key? key}) : super(key: key);
}
